package com.example.quiz.dao;

import com.example.quiz.model.Question;
import org.apache.ibatis.annotations.Param;
import java.util.List;

public interface QuestionMapper {
        int insert(Question question);

        Question selectById(Long id);

        List<Question> selectPagedQuestions(@Param("offset") int offset,
                        @Param("limit") int limit,
                        @Param("categoryId") Long categoryId,
                        @Param("difficulty") Integer difficulty);

        int selectTotalCount(@Param("categoryId") Long categoryId,
                        @Param("difficulty") Integer difficulty);

        List<Question> selectByCategoryId(Long categoryId);

        List<Question> selectByDifficulty(Integer difficulty);

        List<Question> selectRandom(@Param("limit") int limit);

        int deleteById(Long id);

        int update(Question question);

        List<Question> selectAll();

        int selectCountByCategoryId(@Param("categoryId") Long categoryId);

        List<Question> selectByIds(@Param("ids") List<Long> ids);
}
